home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_teo_crushblock.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  108 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEO_CrossBlocks.cog
  4. #
  5. # Crushing Block script
  6. #
  7. # [SXC]
  8. #
  9. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.     message     startup
  14.     message     exited          
  15.     message     timer
  16.     message     entered
  17.     message     arrived
  18.     message     blocked
  19.  
  20.     surface     exitsurf        mask=0x400
  21.     sound       clicksound
  22.     sound       slidesound
  23.     sound       crushsound
  24.     sound       sndstop=gen_stone_stop_c.wav
  25.         
  26.     thing        crushblock    linkid=0 mask=0x405
  27.     thing       player0         local
  28.     thing       deadIndy        local
  29.     
  30.     template    temDeadIndy=indy_sh_actor   local
  31.     keyframe    deathKeyAnim=in_die_buckle.key  local
  32.  
  33.     flex        moveSpeed=10.0
  34.         
  35.     int         resettime=3.0
  36.     int         soundthing      local
  37.     int         crushlock=0     local
  38.     int         clicklock       local
  39.     int         damagecheck=0   local
  40.  
  41. end
  42.  
  43. # ========================================================================================
  44.  
  45. code
  46.  
  47. # ........................................................................................
  48. startup:
  49.     player0 = GetLocalPlayerThing();
  50.     return;
  51.     
  52. # ........................................................................................
  53. entered:
  54.     if ((GetSenderRef() == exitsurf) && (clicklock == 0))
  55.     {
  56.         clicklock = 1;
  57.         PlaySoundLocal(clicksound, 0.7, 0, 0x0, 0);        
  58.     }
  59.     return;                
  60. # ........................................................................................
  61.  
  62. exited:
  63.     if ((GetSenderRef() == exitsurf) && (crushlock == 0))
  64.     {
  65.         crushlock = 1;
  66.         MoveToFrame(crushblock, 1, moveSpeed);   
  67.         PlaySoundLocal(crushsound, 0.7, 0, 0x0, 0);
  68.         SetTimer(resetTime);
  69.     }
  70.     return;
  71.  
  72. # ........................................................................................
  73. timer:
  74.     MoveToFrame(crushblock, 0, (moveSpeed/10));
  75.     soundthing = PlaySoundLocal(slidesound, 0.7, 0, 0x0001, 0);
  76.     return;
  77.         
  78.  
  79. # ........................................................................................
  80. arrived:
  81.     if ((GetCurFrame(crushblock) == 0) && (GetSenderRef() == crushblock) && (crushlock == 1))
  82.     {
  83.         StopSound(soundthing, 0);
  84.         PlaySoundThing(sndstop, crushblock, 1, 3, 10, 0);
  85.         clicklock = 0;
  86.         crushlock = 0;
  87.     }
  88.     return;
  89.  
  90. # ........................................................................................
  91. blocked:
  92.     if ((GetSenderRef() == crushblock) && (damagecheck == 0))
  93.     {
  94.         damagecheck = 1;
  95.         //print("Damaging Indy");
  96.         DamageThing(player0, 1000, 0x1, crushblock);
  97.         SetThingFlags(player0, 0x80000);
  98.         deadIndy = CreateThing(temDeadIndy, player0);
  99.         CaptureThing(deadIndy);
  100.         CopyPlayerHolsters(player0, deadIndy);
  101.         ClearThingFlags(deadIndy, 0x80000);
  102.         PlayKey(deadIndy, deathKeyAnim, 4, 0x14, 0);
  103.     }
  104.     return;
  105.                 
  106. end
  107.  
  108.